package com.itheima.myinner.text8;

public class TestInnerClass {
    public static void main(String[] args) {
        Outer.Inner oi = new Outer().new Inner();//创建Inner的对象
        oi.show();
    }
}
class Outer {
    private int age = 20;//创建other对象,再用对象调用.age/

    class Inner {
        private int age = 15;//可以通过this.age

        public void show() {
            int age = 30; //age
            //需求1: 打印出 30
            System.out.println(age);
            //需求2: 打印出 15
            System.out.println(this.age);

            //需求3: 打印出 20
            Outer outer = new Outer();
            System.out.println(outer.age);
            System.out.println(Outer.this.age);
            System.out.println("inner..show");
        }
    }
}